package com.qyl.deguru.controller.customer;

import java.util.List;

import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;

import com.qyl.deguru.dto.Shop;
import com.qyl.deguru.service.ShopService;
import com.qyl.deguru.service.impl.ShopServiceImple;

/**
 * 商品详细信息
 * */
@Controller
@RequestMapping("/customer/shop")
public class ShopDetailCotroller {
	ShopService shopService=new ShopServiceImple();
	@RequestMapping("/toPro_details")
	public String toPro_details(ModelMap modelMap,int did) {
		//根据id获取商品信息
		Shop shops=shopService.getShopById(did);
		modelMap.addAttribute("shops", shops);
		//详情页面尾部显示四条相关商品信息
		List<Shop> otherShops=shopService.getShop();
		modelMap.addAttribute("otherShops", otherShops);
		return "pro_details";
	}
	
}
